//
//  WSNewsDetailHeader.m
//  WisdomStar
//
//  Created by 谭飞 on 2018/10/31.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "WSNewsDetailHeader.h"

#import "WSNewsDetailInfo.h"

@interface WSNewsDetailHeader ()

@property (weak, nonatomic) IBOutlet UIImageView *picImageView;

@property (weak, nonatomic) IBOutlet UILabel *titleLab;

@property (weak, nonatomic) IBOutlet UILabel *timeLab;

@property (weak, nonatomic) IBOutlet UILabel *contentLabel;

@property (weak, nonatomic) IBOutlet UIView *commentView;


@end

@implementation WSNewsDetailHeader

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.commentView setBorder:kSeparatorColor borderWidth:0.5f borderType:UIBorderSideTypeBottom];
}

// 计算内容高度
- (CGFloat)contentHeight {
//    CGSize size = [self.contentLabel.text sizeWithAttributes:@{NSFontAttributeName: WSFontMake(13)}];
    return self.contentLabel.xmg_bottom + 70.f;
}

#pragma mark - Setter

- (void)setDetailInfo:(WSNewsDetailInfo *)detailInfo {
    _detailInfo = detailInfo;
    
    [self.picImageView imageWithURL:detailInfo.picture defaultImage:kPlaceHolderImage];
    
    self.titleLab.text = detailInfo.title;
    self.timeLab.text = detailInfo.create_at;
}

@end
